﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using HsTec.DigitalPlatform.DataAccess;
using HsTec.DigitalPlatform.DataAccess.Search;

namespace HsTec.DigitalPlatform.Business
{
    public class PlayerInfoManager
    {
        PlayerInfoRepository playerinforepository = new PlayerInfoRepository();

        public void Add(PlayerInfo playerinfo)
        {
            playerinforepository.Add(playerinfo);
        }

        public void Delete(PlayerInfo playerinfo)
        {
            playerinforepository.Delete(playerinfo);
        }

        public void Save()
        {
            playerinforepository.Save();
        }

        public PlayerInfo GetPlayerInfoByID(int id)
        {
            return playerinforepository.GetPlayerInfoByID(id);
        }

        public IQueryable<PlayerInfo> FindALLPlayerInfo()
        {
            return playerinforepository.FindALLPlayerInfo();
        }

        public IQueryable<ViPlayerInfo> PageInfo(int page, int rp, string sortname, string sortorder,PlayerSearchModel pageWhere)
        {
            return playerinforepository.PageInfo(page, rp, sortname, sortorder, pageWhere);
        }

        public int GetAllCount(PlayerSearchModel pageWhere)
        {
            return playerinforepository.GetAllCount(pageWhere);
        }

        public int GetMaxID()
        {
            return playerinforepository.GetMaxID();
        }

        public bool Exist(string playerno)
        {
            return playerinforepository.Exist(playerno);
        }

        public bool Exist(string playerno, string password)
        {
            return playerinforepository.Exist(playerno, password);
        }

        public ViPlayerInfo GetPlayerInfoByPassword(string playerno, string password)
        {
            return playerinforepository.GetPlayerInfoByPassword(playerno, password);
        }

        public string GenerationNo(string sortorder, string sortname)
        {
            return playerinforepository.GenerationNo(sortorder, sortname);
        }
    }
}
